<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>

<body>
    <div id="app"></div>

    <template id="my-app">
        <button v-on:click="handle">按钮</button>
        <button @click="add">{{count}}</button>
        <div style="height: 100px;width: 100px;border: 1px solid #000;" @mouseenter="enter" @click="add"></div>
        <div style="height: 100px;width: 100px;border: 1px solid #000;" @="{click:add,mouseleave:leave}"></div>
        <button @click="handleClick($event,'张三',18)">按钮</button>
    </template>

    <script>
        const App = {
            template: '#my-app',
            data() {
                return {
                    count: 0
                }
            },
            methods: {
                handle() {
                    console.log('按钮被点击了')
                },
                add() {
                    console.log("点击");
                    this.count++
                },
                enter() {
                    console.log('鼠标进入了')
                },
                leave() {
                    console.log('鼠标离开了')
                },
                handleClick(e,name,age) {
                    console.log(e,name,age)
                }
            }
        }

        Vue.createApp(App).mount('#app')
    </script>
</body>

</html>